<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="bp" value="${pageContext.request.contextPath}"></c:set>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<jsp:useBean id="timestamp" class="java.util.Date"/>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>用户个人信息</title>
    <!-- Bootstrap Styles-->
    <link href="${bp}/static/assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FontAwesome Styles-->
    <link href="${bp}/static/assets/css/font-awesome.css" rel="stylesheet" />
    <!-- Morris Chart Styles-->
    <link href="${bp}/static/assets/js/morris/morris-0.4.3.min.css" rel="stylesheet" />
    <!-- Custom Styles-->
    <link href="${bp}/static/assets/css/custom-styles.css" rel="stylesheet" />
    <!-- Google Fonts-->
    <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
    <link rel="stylesheet" href="${bp}/static/assets/js/Lightweight-Chart/cssCharts.css">
</head>

<body>
<div id="wrapper">
    <nav class="navbar navbar-default top-navbar" role="navigation">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="${bp}/user/index">
                <strong>蓝天洗衣管理系统</strong>
            </a>

            <div id="sideNav" href="">
                <i class="fa fa-caret-right"></i>
            </div>
        </div>

        <ul class="nav navbar-top-links navbar-right">
            <!-- /.dropdown -->
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
                    <i class="fa fa-bell fa-fw"></i>

                    <c:if test="${orderconet > 0}">
                        <span class="badge" style="color: red">${orderconet}</span>
                    </c:if>
                    <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu dropdown-alerts">
                    <li>
                        <a href="${bp}/order/orderAll">
                            <c:if test="${orderconet > 0}">
                                <i class="fa fa-comment fa-fw"></i>${orderconet}个订单等待您处理
                            </c:if>
                        </a>
                    </li>
                </ul>
                <!-- /.dropdown-alerts -->
            </li>
            <!-- /.dropdown -->
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
                    <i class="fa fa-user fa-fw"></i>
                    <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu dropdown-user">
                    <li>
                        <a href="${bp}/user/userInfo">
                            <i class="fa fa-user fa-fw"></i> 用户信息</a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a href="${bp}/user/loginOut">
                            <i class="fa fa-sign-out fa-fw"></i> 退出系统</a>
                    </li>
                </ul>
                <!-- /.dropdown-user -->
            </li>
            <!-- /.dropdown -->
        </ul>
    </nav>
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="index.html">
            <strong>蓝天洗衣管理系统</strong>
        </a>

        <div id="sideNav" href="">
            <i class="fa fa-caret-right"></i>
        </div>
    </div>

    <ul class="nav navbar-top-links navbar-right">
        <!-- /.dropdown -->
        <li class="dropdown">
            <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
                <i class="fa fa-bell fa-fw"></i>
                <i class="fa fa-caret-down"></i>
            </a>
            <ul class="dropdown-menu dropdown-alerts">
                <li>
                    <a href="#">
                        <div>
                            <i class="fa fa-comment fa-fw"></i> New Comment
                            <span class="pull-right text-muted small">4 min</span>
                        </div>
                    </a>
                </li>
                <li class="divider"></li>
                <li>
                    <a href="#">
                        <div>
                            <i class="fa fa-twitter fa-fw"></i> 3 New Followers
                            <span class="pull-right text-muted small">12 min</span>
                        </div>
                    </a>
                </li>
                <li class="divider"></li>
                <li>
                    <a href="#">
                        <div>
                            <i class="fa fa-envelope fa-fw"></i> Message Sent
                            <span class="pull-right text-muted small">4 min</span>
                        </div>
                    </a>
                </li>
                <li class="divider"></li>
                <li>
                    <a href="#">
                        <div>
                            <i class="fa fa-tasks fa-fw"></i> New Task
                            <span class="pull-right text-muted small">4 min</span>
                        </div>
                    </a>
                </li>
                <li class="divider"></li>
                <li>
                    <a href="#">
                        <div>
                            <i class="fa fa-upload fa-fw"></i> Server Rebooted
                            <span class="pull-right text-muted small">4 min</span>
                        </div>
                    </a>
                </li>
                <li class="divider"></li>
                <li>
                    <a class="text-center" href="#">
                        <strong>See All Alerts</strong>
                        <i class="fa fa-angle-right"></i>
                    </a>
                </li>
            </ul>
            <!-- /.dropdown-alerts -->
        </li>
        <!-- /.dropdown -->
        <li class="dropdown">
            <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
                <i class="fa fa-user fa-fw"></i>
                <i class="fa fa-caret-down"></i>
            </a>
            <ul class="dropdown-menu dropdown-user">

                <li class="divider"></li>
                <li>
                    <a href="${bp}/user/loginOut">
                        <i class="fa fa-sign-out fa-fw"></i> 退出系统</a>
                </li>
            </ul>
            <!-- /.dropdown-user -->
        </li>
        <!-- /.dropdown -->
    </ul>
    </nav>
    <!--/. NAV TOP  -->
    <nav class="navbar-default navbar-side" role="navigation">
        <div class="sidebar-collapse">
            <ul class="nav" id="main-menu">
                <li>
                    <a  href="${bp}/user/index">
                        <i class="fa fa-dashboard"></i>首页</a>
                </li>
                <li>
                    <a class="active-menu" href="${bp}/user/user?page=1">
                        <i class="fa fa-dashboard"></i>用户管理</a>
                </li>
                <li>
                    <a href="${bp}/order/orderAll">
                        <i class="fa fa-qrcode"></i>订单管理</a>
                </li>
                <li>
                    <a href="${bp}/equipment/equipment?page=1">
                        <i class="fa fa-desktop"></i>消耗品管理</a>
                </li>
                <li>
                    <a href="${bp}/log/log">
                        <i class="fa fa-bar-chart-o"></i>日志记录</a>
                </li>
                <li>
                    <a href="${bp}/work/work?page=1">
                        <i class="fa fa-table"></i>职员管理</a>
                </li>
            </ul>

        </div>

    </nav>
    <!-- /. NAV SIDE  -->
    <!-- 内容块 -->
    <div id="page-wrapper">
        <!-- header -->
        <div class="header">
            <h1 class="page-header">
               个人信息
                <small>欢迎您，${sessionScope.user.name}</small>
            </h1>
            <!-- 模拟路由地址 -->
            <ol class="breadcrumb">
                <li>
                    <a href="user.html">个人信息</a>
                </li>
                <!-- <li>
                    <a href="#">Dashboard</a>
                </li>
                <li class="active">Data</li> -->
            </ol>

        </div>
        <div id="page-inner">

            <div class="row">
                <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">

                        </div>
                        <div class="panel-body">
                            <div class="table-responsive">




                                <form  id = "user"  class="login-form">
                                    <input type="hidden" name="id" value="${sysUser.id}">
                                    <div class="form-group">
                                        <label class="sr-only" >名字</label>
                                        <input type="text" name="name" value="${sysUser.name}"  class="form-username form-control" >
                                    </div>
                                    <div class="form-group">
                                        <label class="sr-only" >用户名</label>
                                        <input type="text" name="username" value="${sysUser.username}"  class="form-password form-control" >
                                    </div>
                                    <div class="form-group">
                                        <label class="sr-only" >密码</label>
                                        <input type="text" name="password"  value="${sysUser.password}"  class="form-password form-control" >
                                    </div>
                                    <div class="form-group">
                                        <label class="sr-only" >手机号</label>
                                        <input type="text" name="phone" value="${sysUser.phone}"  class="form-password form-control" >
                                    </div>
                                    <div class="form-group">
                                        <label class="sr-only" >地址</label>
                                        <input type="text" name="addr" value="${sysUser.addr}"  class="form-password form-control" >
                                    </div>
                                    <button type="button" onclick="add()"  class="btn">修改</button>
                                </form>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
            <!-- /. ROW  -->
        </div>
        <!-- /. PAGE INNER  -->
    </div>
    <!-- /. PAGE WRAPPER  -->
</div>
<!-- /. WRAPPER  -->
<!-- JS Scripts-->
<!-- jQuery Js -->
<script src="${bp}/static/assets/js/jquery-3.2.1.min.js"></script>
<!-- Bootstrap Js -->
<script src="${bp}/static/assets/js/bootstrap.min.js"></script>

<!-- Metis Menu Js -->
<script src="${bp}/static/assets/js/jquery.metisMenu.js"></script>
<!-- Morris Chart Js -->
<script src="${bp}/static/assets/js/morris/raphael-2.1.0.min.js"></script>
<script src="${bp}/static/assets/js/morris/morris.js"></script>


<script src="${bp}/static/assets/js/easypiechart.js"></script>
<script src="${bp}/static/assets/js/easypiechart-data.js"></script>

<script src="${bp}/static/assets/js/Lightweight-Chart/jquery.chart.js"></script>

<!-- Custom Js -->
<script src="${bp}/static/assets/js/custom-scripts.js"></script>

<script type="text/javascript">


    function add() {
        $.ajax({
            type:"post",
            url:"${bp}/user/userAdminUpdate",
            data: $('#user').serialize(),
            success : function (msg) {
                if(msg == 1){
                    alert("更新成功")
                    window.location.reload()
                }
                if(msg == 2){
                    alert("更新失败")
                    window.location.reload()
                }
            }
        })
    }
</script>

</body>

</html>